package com.hcandtx.Bms.service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hcandtx.Bms.Vo.ProductVo;
import com.hcandtx.Bms.bean.Product;
import com.hcandtx.Bms.mapper.ProductMapper;
import com.hcandtx.Bms.service.IProductService;

@Service("productService")
public class ProductService implements IProductService {

	@Autowired
	ProductMapper productMapper;
	
	@Override
	public List<ProductVo> findAllByKey(String keyWord) {
		
		return productMapper.findAllByKey(keyWord);
	}

	@Override
	public Product findById(int id) {
		// TODO Auto-generated method stub
		return productMapper.findById(id);
	}

	@Override
	public int deleteById(int productId) {
		// TODO Auto-generated method stub
		return productMapper.deleteById(productId);
	}

	@Override
	public int update(Product product) {
		// TODO Auto-generated method stub
		return productMapper.update(product);
	}

	@Override
	public int updateShelf(int productId, String ShelfStatus) {
		// TODO Auto-generated method stub
		return productMapper.updateShelf(productId,ShelfStatus);
	}

	@Override
	public int insert(Product product) {
		// TODO Auto-generated method stub
		return productMapper.insert(product);
	}

	@Override
	public int updateImage(int productId, String imaageUrl) {
		// TODO Auto-generated method stub
		return productMapper.updateImage(productId,imaageUrl);
	}

	@Override
	public int upanddownShelfAll(String productShelfStatusNo) {
		
		return productMapper.upanddownShelfAll(productShelfStatusNo);
	}

	@Override
	public List<ProductVo> findAll() {
		
		return productMapper.findAll();
	}

	@Override
	public List<ProductVo> getbook() {
		// TODO Auto-generated method stub
		return productMapper.getbook();
	}

	@Override
	public List<ProductVo> findAllbooks(int id) {
		// TODO Auto-generated method stub
		return productMapper.findAllbooks(id);
	}

	@Override
	public List<ProductVo> search(String searchValue) {
		// TODO Auto-generated method stub
		return productMapper.search(searchValue);
	}

	@Override
	public List<ProductVo> searchbook(String search) {
		// TODO Auto-generated method stub
		return productMapper.searchbook(search);
	}

	



}
